#ifndef __HAL_CS_F61_IIC_H
#define __HAL_CS_F61_IIC_H
#include "compile_option.h"
#include "hal_cs_f61_framework.h"
#include <stdint.h>

////////////////////////////////////////////////////
/* The parameter of IIC */
#define IIC_SDA				Reuse_PA13
#define IIC_SCL				Reuse_PA12

#define IIC_ADDR			0x50	    //I2CSLAVE_ADDR;
#define IIC_RX_FIFO_LEVEL		1		//once one byte received,interrupt generated
#define IIC_TX_FIFO_LEVEL		8

extern void HAL_IIC_Slave_Init(void);

////////////////////////////////////////////////////


extern volatile uint8_t iicErrTime;


typedef struct{
	unsigned Is_Wait_RegAddr: 1;
	unsigned I2C_Cmd_Done  : 1;
	unsigned I2C_SlaveAddr_Matched: 1;
} I2C_State;

extern void I2C0_BusyError(void); 

#endif	/* __HAL_CS_F61_IIC_H */



